package com.yc.cinema;

import java.util.List;

public class HelloBean {

    private String name;
    private int age;
    private List<String> friends;

    public HelloBean(String name, int age){
        this.name = name;
        this.age = age;
    }

    public HelloBean(){ }

    public void hello() {
        System.out.println("hello " + name + "!" + "我" + age + "岁");
    }

    public void init(){
        System.out.println(" hello Bean 构建完成");
    }

    public void gameOver(){
        System.out.println(" hello Bean 销毁完成");
    }

    // 静态工厂方法
    public static HelloBean create() {
        System.out.println("===========create==========");
        return new HelloBean();
    }

    // 实例工厂方法
    public HelloBean newInstance() {
        System.out.println("===========newInstance==========");
        return new HelloBean();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public List<String> getFriends() {
        return friends;
    }

    public void setFriends(List<String> friends) {
        this.friends = friends;
    }
}
